package com.leap.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@Builder
@Schema(description = "聊天记录")
@TableName(value = "chatrecord" ,autoResultMap = true)
public class ChatRecord {

    @TableId(type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @TableField("account_id")
    @Schema(description = "用户Id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long accountId;

    @TableField(value = "title")
    @Schema(description = "用户对话标题")
    private String title;

    @TableField(value = "messages")
    @Schema(description = "对话内容")
    private String message;

    @TableField(value = "num")
    @Schema(description = "对话次数")
    private int num;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "最新对话时间")
    private LocalDateTime updateTime;

}
